import React, { Component } from 'react'
import {
  StyleSheet,
  Text,
  View,
  Button
} from 'react-native'
import {Container,Title} from './index.css'
import { inject, observer } from 'src/core/store'
@inject('DemoDevStore')
@observer
export default class extends Component {
  static navigationOptions = {
    title: 'demo home title'
  }

  componentDidMount () {
    // console.log(`this.props.screenProps.store`, this.props)
  }

  render () {
    const {navigate} = this.props.navigation
    return (
      <Container>
        <Title className="title">Home</Title>
        <Button onPress={() => navigate('DemoAbout')} title="to about"/>
        <Text>{this.props.DemoDevStore.data}</Text>
        <Button onPress={() => this.props.DemoDevStore.sub()} title="sub -1"/>
      </Container>
    )
  }
}
